import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        System.out.println(getOneCount(-1));
        System.out.println(getOneCount(10));//1010
    }

    private static int getOneCount(int n) {
        int count = 0;
        while(n != 0) {
            n = n & (n - 1);
            count++;
        }
        return count;
    }

    public static void main5(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = maxTotalYue(a,b);
        System.out.println(c);
    }
    private static int maxTotalYue(int a, int b) {
        int c = a % b;
        while(c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        return b;
    }

    public static void main4(String[] args) {
        double sum = 0;
        int type = 1;
        for (int i = 1; i <= 100; i++) {
            sum += type* 1.0 / i;
            type *= -1;
        }
        System.out.println(sum);
    }
    public static boolean isShui(int n) {
        int len = 0;
        int[] arr = new int[10];
        int t = n;
        while(t != 0) {
            arr[len++] = t % 10;
            t /= 10;
        }
        int sum = 0;
        for (int i = 0; i < len; i++) {
            sum += (int)Math.pow(arr[i], len);
        }
        return sum == n;
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 100; i <= n; i++) {
            if(isShui(i)) {
                System.out.println(i);
            }
        }
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            int t = i;
            while(t != 0) {
                if(t % 10 == 9) {
                    count++;
                }
                t /= 10;
            }
        }
        System.out.println(count);
    }
    public static boolean isSu(int n) {
        if(n <= 1) {
            return false;//这个其实可以就不用写了
        }
        if(n == 2) {
            return true;
        }
        for (int i = 3; i <= Math.pow(n,.5); i+=2) {
            if(n % i == 0) {
                return false;
            }
        }
        return true;
    }
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()) {
            int n = in.nextInt();
            System.out.println(isSu(n));
        }
        System.out.println("结束");
    }
}
